<?php SQLFile::start() ?>

SELECT *
FROM
( exam_session RIGHT JOIN exam USING( exam_id ) )
LEFT JOIN user ON user.stud_no = exam_session.user_id
WHERE exam.org_id = :org_id
ORDER BY user.lastname ASC,
exam_id ASC

<?php return SQLFile::end();
